<?php
/************************FoxPHP威客系统************************/
/*                                                            */
/*  FoxPHP.Com (C)2006-2016 FoxPHP Inc.                       */
/*  This is NOT a freeware, use is subject to license terms   */
/*  FoxPHP威客系统是商业软件,使用于商业用途请购买授权         */
/*  V3.0 2016.3                                               */
/*  foxphp@aliyun.com                                         */
/*  http://www.foxphp.com                                     */
/*                                                            */
/**************************************************************/

namespace Member\Controller;
use Think\Controller;
class PayoutController extends IndexController {
	
	//提现
    public function indexAction(){
		$this->GetLock();
		$this->display();
    }
	
	public function GetLock(){
		$lock=M('Consume')->token(false)->where(" payout_uid=$this->uid AND paytype=4 AND status=1 ")->sum('amount');
		$this->assign('lock',$lock/100);
	}

	public function listAction(){
		$this->GetLock();
		$model=new \Consume\Model\ConsumeModel();
		foreach($model->GetMyPayout(
				//排序
				array(
					array('order'=>'id','name'=>'交易编号'),
					array('order'=>'dateline','name'=>'创建时间'),
					array('order'=>'bankcard','name'=>'提现帐号'),
					array('order'=>'amount','name'=>'交易金额(元)'),
					array('order'=>'fee','name'=>'交易手续费(元)'),
					array('order'=>'status','name'=>'状态')
				)
			) as $key=>$value){
			$this->assign($key,$value);
		}

		$this->display();
	}
	
}